/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __INPUT_HARD_DIRECTX8_FORCEEFFECT_H__
#define __INPUT_HARD_DIRECTX8_FORCEEFFECT_H__

#include <input/hard/ForceEffect.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <vector>
#include <filesystem/String.hpp>

namespace liba
{
namespace input
{
namespace hard
{
namespace directx8
{

class ForceEffect : public hard::ForceEffect
{
	static BOOL CALLBACK EnumEffectsInFileProc( LPCDIFILEEFFECT lpdife, LPVOID pvRef);

	IDirectInputDevice8 * device;

	typedef std::vector<LPDIRECTINPUTEFFECT> Effects;
	Effects effects;
public:    
    ForceEffect( IDirectInputDevice8 * device, const filesystem::String & effect_name );
    ~ForceEffect();

    virtual bool play();
    virtual bool stop();
	virtual bool is_playing();
};

} // namespace directx8
} // namespace hard
} // namespace input
} // namespace liba
using namespace liba;

#endif //__INPUT_HARD_DIRECTX8_FORCEEFFECT_H__